package service;



import entity.Student;

import java.util.List;


// 实现 StudentDAO 接口中的方法，创建自定义的 Service 类
public interface StudentService {
    /**
     * This is the method to be used to create
     * a record in the Student table.
     */
    //插入数据，对学生表来说就是插入姓名和年龄
    public void create(String name, Integer age);
    /**
     * This is the method to be used to list down
     * a record from the Student table corresponding
     * to a passed student id.
     */
    // 获取指定 id 的学生
    public Student getStudent(Integer id);
    /**
     * This is the method to be used to list down
     * all the records from the Student table.
     */
    // 获取所有学生信息
    public List<Student> listStudents();
    /**
     * This is the method to be used to delete
     * a record from the Student table corresponding
     * to a passed student id.
     */
    // 根据学生 id 删除一条记录
    public void delete(Integer id);
    /**
     * This is the method to be used to update
     * a record into the Student table.
     */
    // 根据学生 id 更新学生年龄
    public void update(Integer id, Integer age);


}
